from django.core.management.base import BaseCommand
from apps.oaauth.models import OAUser, OADepartment
from rest_framework.response import Response


class Command(BaseCommand):
    def handle(self, *args, **options):
        boarder = OADepartment.objects.get(name='董事会')
        developer = OADepartment.objects.get(name='产品开发部')
        operator = OADepartment.objects.get(name='运营部')
        saler = OADepartment.objects.get(name='销售部')
        hr = OADepartment.objects.get(name='人事部')
        finance = OADepartment.objects.get(name='财务部')
        # 添加. jackson: 开发部门 员工
        jackson = OAUser.objects.create_user(email="a13055743639@163.com", realname='杰森', password='111111',
                                           department=developer)
        self.stdout.write('初始用户创建成功！')